package com.cg.design.graphicdesignpattern.abstractfactory.factory;

import java.util.ArrayList;

/**
 * 抽象的零件：Tray(有"托盘"的意思)类(表示一个含有多个Link类和Tray类的容器)
 *
 * @program: LeetCode->Tray
 * @description: 抽象的零件：Tray(有"托盘"的意思)类(表示一个含有多个Link类和Tray类的容器)
 * @author: cg
 * @create: 2022-03-21 20:44
 **/
public abstract class Tray extends Item {
    /**
     * 用于存放Link类和Tray类，它们都是Item的子类
     */
    protected ArrayList<Item> tray = new ArrayList();

    public Tray(String caption) {
        super(caption);
    }

    public void add(Item item) {
        tray.add(item);
    }

}
